﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.ComponentModel;

namespace KaKaSongGame
{
    public class MyRect : INotifyPropertyChanged
    {
        double x;
        public double X
        {
            set
            {
                if (x != value)
                {
                    x = value;
                    onPropertyChanged("X");
                }
            }
            get
            {
                return x;
            }
        }

        double y;
        public double Y
        {
            set
            {
                if (y != value)
                {
                    y = value;
                    onPropertyChanged("Y");
                }
            }
            get
            {
                return y;
            }
        }

        double width;
        public double Width
        {
            set
            {
                if (width != value)
                {
                    width = value;
                    onPropertyChanged("Width");
                }
            }
            get
            {
                return width;
            }
        }

        double height;
        public double Height
        {
            set
            {
                if (height != value)
                {
                    height = value;
                    onPropertyChanged("Height");
                }
            }
            get
            {
                return height;
            }
        }

        public event PropertyChangedEventHandler PropertyChanged;

        void onPropertyChanged(string propertyname)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this,
                    new PropertyChangedEventArgs(propertyname));
            }
        }
    }
}
